
const { apiPreFix } = require('../config').server
const userController = require('../controllers/admin/user')
const adContainer = require('../controllers/admin/ad')
const billContainer = require('../controllers/admin/bill')
module.exports = (router) => {
  // 登陆
  router.post(`${apiPreFix}/admin/login`, async ctx => {
    await userController.login(ctx)
  })
  // 用户信息
  router.post(`${apiPreFix}/admin/userInfo`, async ctx => {
    await userController.userInfo(ctx)
  })
  // 广告列表
  router.post(`${apiPreFix}/admin/adList`, async ctx => {
    await adContainer.adList(ctx)
  })
  // 广告详情
  router.post(`${apiPreFix}/admin/adDetail`, async ctx => {
    await adContainer.adDetail(ctx)
  })
  // 改变广告状态
  router.post(`${apiPreFix}/admin/updateState`, async ctx => {
    await adContainer.updateState(ctx)
  })
  // 任务列表
  router.post(`${apiPreFix}/admin/billList`, async ctx => {
    await billContainer.billList(ctx)
  })
  // 任务详情
  router.post(`${apiPreFix}/admin/billDetail`, async ctx => {
    await billContainer.billDetail(ctx)
  })
}